<template>
    <div class="container" style="margin-top: 70px; background: rgb(255, 255, 255);">
        <div class="news-nav-header">
            <a href="/news" class="news-go-back">实时新闻 </a>
            <span>&gt; 新闻详情</span>
        </div>
        <div class="news-article">
            <div class="news-title">{{detail.title}}</div>
            <div class="news-time">撰稿时间：{{detail.inputtime}}&nbsp;&nbsp;作者：{{detail.author}}</div>
            <div class="news-article-content" v-html="detail.content"></div>
        </div>
    </div>
</template>
<script>
import { getNewsDetail } from '@/api'
export default {
    data() {
        return {
            detail: {}
        }
    },
    computed: {
        id() {
            return this.$route.query.id
        }
    },
    methods: {
        init() {
            let params = {
                id: this.id
            }
            getNewsDetail(params).then(res => {
                this.detail = res.data
            })
        }
    },
    mounted() {
        this.init()
    }
}
</script>
